-
Notifications
You must be signed in to change notification settings - Fork 12
Introduce batch support. #136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
There is an existing patch(es) for this commit SHA: Please note that the status that is posted is not in the context of this PR but rather the (latest) existing patch and that may affect some tests that may depend on the particular PR. If your tests do not rely on any PR-specific values (like base or head branch name) then your tests will report the same status. If you would like a patch to run in the context of this PR and abort the other(s), comment 'evergreen retry'. |
| @Override | ||
| public void addBatch(String mql) throws SQLException { | ||
| checkClosed(); | ||
| throw new SQLFeatureNotSupportedException("TODO-HIBERNATE-35 https://jira.mongodb.org/browse/HIBERNATE-35"); | ||
| } | ||
|
|
||
| @Override | ||
| public void clearBatch() throws SQLException { | ||
| checkClosed(); | ||
| throw new SQLFeatureNotSupportedException("TODO-HIBERNATE-35 https://jira.mongodb.org/browse/HIBERNATE-35"); | ||
| } | ||
|
|
||
| @Override | ||
| public int[] executeBatch() throws SQLException { | ||
| checkClosed(); | ||
| closeLastOpenResultSet(); | ||
| throw new SQLFeatureNotSupportedException("TODO-HIBERNATE-35 https://jira.mongodb.org/browse/HIBERNATE-35"); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are not implemented because Hibernate relies on PreparedStatement methods for batching.
|
Let's remove Update: we decided to leave it, as removing it causes code restructuring (otherwise the code looks weird), and we don't want to do that. Continue having this method seems to be a lesser burden than removing it. |
src/integrationTest/java/com/mongodb/hibernate/jdbc/MongoPreparedStatementIntegrationTests.java
Outdated
Show resolved
Hide resolved
src/integrationTest/java/com/mongodb/hibernate/jdbc/MongoPreparedStatementIntegrationTests.java
Outdated
Show resolved
Hide resolved
src/integrationTest/java/com/mongodb/hibernate/jdbc/MongoPreparedStatementIntegrationTests.java
Outdated
Show resolved
Hide resolved
|
|
||
| @ParameterizedTest(name = "test not supported update elements. Parameters: option={0}") | ||
| @ValueSource(strings = {"hint", "collation", "arrayFilters", "sort", "upsert", "c"}) | ||
| void testNotSupportedUpdateElements(String unsupportedElement) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are not called "element", they are called "option". See https://www.mongodb.com/docs/manual/reference/command/update/. Let's make all the changes needed to reflect that.
The same applies to testNotSupportedDeleteElements.
| } | ||
|
|
||
| @ParameterizedTest(name = "test not supported update elements. Parameters: option={0}") | ||
| @ValueSource(strings = {"hint", "collation", "arrayFilters", "sort", "upsert", "c"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect, we should use both keys and values, like "hint: 'abc'", here, as otherwise the { _id: 1 } value currently used as the value of each option is not always valid. If we use a valid value for each option, then having an exception makes it more clear the the option name itself caused it.
The same applies to testNotSupportedDeleteElements.
…redStatementIntegrationTests.java Co-authored-by: Valentin Kovalenko <[email protected]>
…redStatementIntegrationTests.java Co-authored-by: Valentin Kovalenko <[email protected]>
…redStatementIntegrationTests.java Co-authored-by: Valentin Kovalenko <[email protected]>
https://jira.mongodb.org/browse/HIBERNATE-40
https://jira.mongodb.org/browse/HIBERNATE-35